package com.xingxue.logistics.common.dto;

import org.apache.commons.lang3.builder.MultilineRecursiveToStringStyle;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.util.List;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel("菜单")
public class SysMenu {

    @ApiModelProperty("菜单ID")
    private Integer id;

    @ApiModelProperty("菜单名称")
    private String name;

    @ApiModelProperty("菜单链接")
    private String url;

    @ApiModelProperty("父级菜单ID")
    private Integer parentId;

    @ApiModelProperty("状态(0:无效;1:有效)")
    private Integer state;

    @ApiModelProperty("下级菜单（树形数据时有值，List数据时为空）")
    private List<SysMenu> children;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Integer getStatus() {
        return state;
    }

    public List<SysMenu> getChildren() {
        return children;
    }

    public void setChildren(List<SysMenu> children) {
        this.children = children;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, new MultilineRecursiveToStringStyle())
                .append("id", id)
                .append("name", name)
                .append("url", url)
                .append("parentId", parentId)
                .append("state", state)
                .append("children", children)
                .toString();
    }
}